﻿#ifndef USERINPUTUI_H
#define USERINPUTUI_H

#include <QCryptographicHash>
#include <QDebug>
#include <QDialog>
#include <QKeyEvent>
#include <QSettings>
#include "user.h"

namespace Ui {
class UserInputUi;
}

class UserInputUi : public QDialog {
  Q_OBJECT
 public:
  explicit UserInputUi(User user, QWidget* parent = nullptr);

  ~UserInputUi();

  int getThePassword();

  bool isOK();

  const User getLoginUser();

  UserInputUi& operator<<(User user);

 signals:

 private slots:
  void on_pushButton_num_1_clicked();

  void on_pushButton_num_6_clicked();

  void on_pushButton_num_2_clicked();

  void on_pushButton_num_3_clicked();

  void on_pushButton_num_4_clicked();

  void on_pushButton_num_5_clicked();

  void on_pushButton_num_7_clicked();

  void on_pushButton_num_8_clicked();

  void on_pushButton_num_9_clicked();

  void on_pushButton_reset_clicked();

  void on_pushButton_cancle_clicked();

  void on_pushButton_ok_clicked();

 private:
  Ui::UserInputUi* ui;
  void keyPressEvent(QKeyEvent* e);
  bool is_ok = false;

  QMap<QString, User> users;

  User login_user{};
};

#endif  // USERINPUTUI_H
